package com.dk.service.seller;

import com.alibaba.dubbo.config.annotation.Service;
import com.dk.mapper.seller.TbSellerMapper;
import com.dk.pojo.seller.TbSeller;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Service
@Component
public class SellerServiceImpl implements SellerService {
    @Resource
    private TbSellerMapper sellerMapper;
    @Override
    public TbSeller SellerBySellerId(String sellerId) {
        return sellerMapper.selectByPrimaryKey(sellerId);
    }

    @Override
    public int insertSeller(TbSeller seller) {
        return sellerMapper.insertSelective(seller);
    }

    @Override
    public List<TbSeller> listSeller() {
        return sellerMapper.selectByExample(null);
    }

    @Override
    public int examineSeller(String staus, String sellerId) {
        TbSeller seller = new TbSeller();
        seller.setStatus(staus);
        seller.setSellerId(sellerId);
        return sellerMapper.updateByPrimaryKeySelective(seller);
    }
}
